/*
 * Created: Author: Aléx Carvalho / Date: Jan 23, 2015
 * 
 * Changed: $Author: ac280593@gmail.com $ / $Date: 2015-03-13 10:38:16 +0000 (Fri, 13 Mar 2015) $
 */
package com.cpm.entities.converters;

import com.cpm.entities.types.IndicatorDirectionType;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

@Converter(autoApply = true)
public class IndicatorDirectionPersistenceConverter implements AttributeConverter<IndicatorDirectionType, Integer> {

    @Override
    public Integer convertToDatabaseColumn(IndicatorDirectionType attribute) {
        return TypeConverter.getId(attribute);
    }

    @Override
    public IndicatorDirectionType convertToEntityAttribute(Integer dbData) {
        return TypeConverter.convertTo(IndicatorDirectionType.class, dbData);
    }
    
}